import Vue from 'vue'
// 引入国际化语言插件
import VueI18n from 'vue-i18n'
import localeEn from 'element-ui/lib/locale/lang/en'// 引入vue-i18n语言
import localeZh from 'element-ui/lib/locale/lang/zh-CN'// 引入vue-i18n语言

import customEn from './en'
import customZh from './zh'
// 注册
Vue.use(VueI18n)
// 创建实例
export default new VueI18n({
  locale: localStorage.getItem('lang') || 'zh',
  messages: {
    zh: {
      morning: '早安',
      day: '祝你开心每一天！',
      ...localeZh,
      ...customZh
    },
    en: {
      morning: 'Good morning',
      day: 'Wish you happy every day!',
      ...localeEn,
      ...customEn
    }
  }
})
